package jmc.core.dao;


import java.util.HashMap;
import java.util.List;

import jmc.util.exception.GenericDataAccessException;

public interface GenericDAO<T> {

	public void save(T newInstance)throws GenericDataAccessException;
	
	public void update(T persistenceInstance)throws GenericDataAccessException;
	
	public void remove(T persistenceInstance)throws GenericDataAccessException;
	
	public List<T> getAll()throws GenericDataAccessException ;
	
	public T getByPrimaryKey(Long id)throws GenericDataAccessException ;
	
	public T getByPrimaryKey(String id)throws GenericDataAccessException ;
	
	public T getByPrimaryKey(int id)throws GenericDataAccessException ;
	
	public List<T> findByObjectCriteria(T object)throws GenericDataAccessException;
	
	public List<T> findByObjectCriteria(HashMap<String, Object> res)throws GenericDataAccessException;

	public void removeAll(List<T> objects)throws GenericDataAccessException ;

	public void saveOrUpdateAll(List<T> objects)throws GenericDataAccessException ;
	//public List<T> getByCriterio(DetachedCriteria criteria);
}
